<?php
/**
 * Dao of Customer
 *
 * @author fsqijy
 */

require_once BaseUtil::getModulePath ( "base" ) . '/models/BaseDao.php';

class MetadataSetDao extends BaseDao {
	
	protected $_name;
	
	public function _setup() {
		$this->_name = $this->prefix () . "metadata_sets";
		parent::_setup ();
	}
	
	public function addSetData($data) {
		//$where = $this->db_w->quoteInto('id = ?', $id);
		return $this->insertData ( $data );
	}
	
	public function getSetById($id) {
		return $this->db_r->fetchRow ( 'select * from '.$this->_name.' where id=' . $id );
	}
	
    public function getMetadataSet(){
        $select = $this->db_r->select();
        $select->from($this->_name,"*");
        $select->where($this->_name . ".is_delete = 0");
        $sql = $select->__toString();
        $result = $this->db_r->fetchAll($sql);
        return $result;
    }

}
